<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Kuyuan\Phpwidget\Date;

class Deposit extends Model
{
    use HasFactory;

    public function getTimeAttribute()
    {
        return Date::shortFormat(strtotime($this->created_at));
    }

    /**
     * 用户信息
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function member()
    {
        return $this->hasOne(Member::class,'id','member_id');
    }
}
